<?php echo $this->Html->docType(); ?> 
<html lang="nl" xml:lang="nl" xmlns="http://www.w3.org/1999/xhtml">
<head>
	<?php echo $this->Html->charset(); ?>
    <title>Rugbyclub Dwingeloo - <?php echo $title_for_layout?></title>
	<?php 
	echo $this->Html->css('rcd'). "\n";
	echo (isset($module)) ? $this->Html->css($module) . "\n" : "";
	echo $this->Html->meta('favicon.ico', '/favicon.ico', array('type' => 'icon')) . "\n";
	?>
	<link rel="stylesheet" type="text/css" href="/css/jquery.lightbox-0.5.css" media="screen" />
	
	<!--[if IE 7]>
	<link rel="stylesheet" href="css/ie7.css" type="text/css" />
	<![endif]-->
</head>
<body>
<div id="wrap">
	<div id="header" class="bg<?php echo rand(1,2) ?>">
		<a class="logo" href="/">Rugbyclub Dwingeloo</a>
		<!--<div class="fotoslide">
			<img src="/img/fotoslide/1.jpg" alt="fotoslide" />
		</div>-->
	</div>
    <?php echo $this->element('menuitems', array($menu_data)); ?>
	<div id="main">
		<div id="updates">
			<div class="upcomingMatches">
				<span class="header"><a href="/programma">Programma</a></span>
				<ul>
					<?php
					//debug($upcomingMatches);
					foreach($upcomingMatches as $match) {
						echo "<li><span class=\"img\">&nbsp;</span>{$match['Match']['dateonly']} {$match['Match']['hometeam']} - {$match['Match']['visitorteam']}</li>";
					}
					?>
				</ul>
			</div>
			<div class="playedMatches">
				<span class="header"><a href="/programma/uitslagen">Uitslagen</a></span>
				<ul>
					<?php
					//debug($upcomingMatches);
					foreach($playedMatches as $match) {
						echo "<li><span class=\"img\">&nbsp;</span>{$match['Match']['result']} {$match['Match']['hometeam']} - {$match['Match']['visitorteam']}</li>";
					}
					?>
				</ul>
			</div>
			<div class="photoalbums">
				<span class="header"><a href="/fotos">Nieuwste foto's</a></span>
				<ul>
					<?php
					foreach($newAlbums as $album)
					{
						$id = substr($album['id'], 66, 19);
						$urlslug = Inflector::slug($album['title']['value']);
						echo "<li><span class=\"img\">&nbsp;</span><a href=\"/fotos?album={$urlslug}&amp;id={$id}\">{$album['title']['value']}</a></li>";
					}
					?>
				</ul>
			</div>
			<div class="attendance">
				<span class="header">Kruisjes</span>
				<ul>
					<?php
					foreach($topAttendances as $attendance)
					{
						echo "<li>\n";
                        echo "<span class=\"img\">&nbsp;</span>\n";
                        echo "{$attendance['User']['username']} <span class=\"right\">{$attendance['Attendance']['weektotal']} - {$attendance['Attendance']['total']}</span>\n";
                        echo "</li>";
					}
					?>
				</ul>
			</div>
            <div class="shoutbox">
                <span class="header"><a href="/shoutbox">Shoutbox</a></span>
                <ul>
                    <li><span class="img">&nbsp;</span>frens: club weer in wereld draait door</li>
                    <li><span class="img">&nbsp;</span>Dames team: Op 8 april is er een opendag bij RugbyDamesDwingeloo. Kom gewoon kijken of train zelfs mee! We zullen we de avond leuk afsluiten bij ''Rock Around de Siepel'' in de Zaagkoele! @ R.</li>
                    <li><span class="img">&nbsp;</span>frens: club weer in wereld draait door</li>
                </ul>
                <span class="header comment">Reageer</span>
                <?php
                echo $form->create('Message', array('action' => 'add'));
                echo $form->input('name', array('value' => 'Naam', 'label' => false));
                echo $form->input('website', array('type' => 'text', 'value' => 'http://', 'label' => false));
                echo $form->input('body', array('value' => 'Bericht', 'label' => false, 'rows' => '3', 'error' => true));
                echo $form->end('Plaats');
                ?>
            </div>
			<!--<div class="loginForm">
				<span class="header">Inloggen</span>
				<?php 
				//echo $form->create('User', array('url' => array('controller' => 'users', 'action' =>'login')));
				//echo $form->input('User.username', array('label' => false, 'value' => 'Gebruikersnaam'));
				//echo $form->input('User.password', array('label' => false, 'value' => 'Wachtwoord'));
				//echo $form->end('Login');
				?>
			</div>-->
		</div>
		<div id="content">
			<?php
			$breadCrumbExpl = ($this->params['url']['url'] == "/") ? array() : explode("/", $this->params['url']['url']); 
			$breadCrumb = "";
			
			foreach($breadCrumbExpl as $key => $expl) {
				$name = inflector::humanize($expl);
				$link = "";
				for($i = 0; $i <= $key; $i++) {
					$link .= "/".$breadCrumbExpl[$i];
				}
				$url = $link;
				$breadCrumb .= " / <a href=\"{$link}\">{$name}</a>";
			}
			
			?>
			<div class="breadcrumb"><a href="/">Rugbyclub Dwingeloo</a><?php echo $breadCrumb; ?></div>
			<div class="body">
			<?php 
			echo $content_for_layout;
			?>
			</div>
		</div>
	</div>
</div>
<div id="footer">
	&copy; Rugbyclub Dwingeloo &copy; 2003 - 2011
</div>
<?php //echo $this->element('sql_dump');?>
<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript" src="/js/jquery.lightbox-0.5.js"></script>
<script type="text/javascript" src="/js/javascript.js"></script>
<?php
debug($_SESSION['shoutbox']);
?>
</body>
</html>